﻿//
// *************************************************************************************
// WP-Framework
//
// Developed by 
// Lukas Kretschmar (lkretschmar.dev@bluewin.ch)
//
// Switzerland, Copyright (c) 2012 lkretschmar
// This content is released under the MIT License (http://opensource.org/licenses/MIT).
//     
// *************************************************************************************
//
//



namespace KretschIT.WP_Fx.EasyMoq.Conditions
{
    internal class AtMost : ICondition
    {
        private int maximum;

        #region Ctor

        public AtMost(int maximum)
        {
            this.maximum = maximum;
        }

        #endregion

        public bool CanBeVerifiedWith(int count)
        {
            return count <= this.maximum;
        }

        public string GetFailureMessage(int count)
        {
            return string.Format("Expected at most {0} call(s) - had {1}.", this.maximum, count);
        }
    }
}
